package com.hiwhitley.easy.day25;

/**
 * Created by hiwhitley on 2016/10/21.
 */
public class FirstBadVersion_278 {
    public static int firstBadVersion(int n) {
        int low = 1;
        int high = n;
        int mid = low + (high - low) / 2;
        while (low < high) {
            if (!isBadVersion(mid)) {
                low = mid + 1;
                mid = low + (high - low) / 2;
            } else {
                high = mid;
                mid = low + (high - low) / 2;
            }
        }
        return mid;
    }

    public static boolean isBadVersion(int num) {
        return false;
    }

    public static void main(String[] args) {
        System.out.println(firstBadVersion(25));
    }
}
